package com.software.backend.login.utils;

import org.springframework.util.StringUtils;

/**
 * @author 王俊坤
 * @version 1.0
 * @date 2022/12/12 19:57
 * 用于判断密码是否合法
 */
public class Password {

    private static final int MIN_PASSWORD_LENGTH =6;
    private static final int MAX_PASSWORD_LENGTH =20;

    public static boolean isValid(String password) {
        if (StringUtils.isEmpty(password) || password.length() < MIN_PASSWORD_LENGTH || password.length() > MAX_PASSWORD_LENGTH){
            return false;
        }
        return true;
    }

}
